<template>
  <el-form>
    <el-form-item label="真实姓名">
      <el-input disabled v-model.trim="user.name" />
    </el-form-item>
    <el-form-item label="登录账号">
      <el-input disabled v-model.trim="user.username" />
    </el-form-item>
    <el-form-item label="邮箱地址">
      <el-input v-model.trim="user.email" />
    </el-form-item>
    <el-form-item label="手机号码">
      <el-input v-model.trim="user.phone" />
    </el-form-item>
    <el-form-item label="登录密码">
      <el-input v-model.trim="user.password" />
    </el-form-item>

    <el-form-item>
      <el-button type="primary" @click="submit">更新个人资料</el-button>
    </el-form-item>
  </el-form>
</template>

<script>
import { editor } from '@/api/user'
export default {
  props: {
    user: {
      type: Object,
      default: () => {
        return {
          name: '',
          email: '',
          phone:'',
          password:'',
          username:'',
        }
      }
    }
  },
  methods: {
    submit() {
      editor(this.user).then(response => {
        if(response.code==20000){
          this.$message({
        message: response.data,
        type: 'success',
        duration: 5 * 1000
      })
        }

      });
      //修改个人资料界面
   
    }
  }
}
</script>
